﻿<phone:PhoneApplicationPage 
    x:Class="CloudWallet.WalletItemsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="#FFF79646">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding AppTitle, Mode=OneTime}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding FileName, Mode=OneTime}" TextTrimming="WordEllipsis" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="4*" />
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="70"/>
                <RowDefinition Height="70"/>
                <RowDefinition />
            </Grid.RowDefinitions>
            <PasswordBox x:Name="passwordBox" FontSize="26"
                         Password="{Binding Password, Mode=TwoWay}"
                         Visibility="{Binding SignedIn, Converter={StaticResource BooleanToVisibilityConverter1}}"                          
                         PasswordChanged="passwordBox_PasswordChanged"  KeyDown="passwordBox_KeyDown"
                         GotFocus="passwordBox_GotFocus" LostFocus="passwordBox_LostFocus" />
            <TextBlock x:Name="passwordBoxWaterMark" Text="Enter Password..."                        
                       VerticalAlignment="Center" Margin="20" FontSize="26" IsHitTestVisible="False" Foreground="Gray"
                       Visibility="Collapsed"  
                       />
            <TextBox x:Name="searchBox" Grid.Row="1" Text="{Binding SearchText,Mode=TwoWay}"
                     GotFocus="searchBox_GotFocus" LostFocus="searchBox_LostFocus"/>
            <TextBlock x:Name="searchTextWaterMark" Text="Search..." Grid.Row="1"
                       VerticalAlignment="Center" Margin="20" FontSize="26" IsHitTestVisible="False" Foreground="Gray"
                       Visibility="Visible" />
            <Button Grid.Column="1" Grid.Row="1" Content="q" 
                    FontFamily="Webdings" FontSize="36" 
                    VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
            <ListBox x:Name="lstItems" Grid.Row="2" Margin="10" Grid.ColumnSpan="2"
                     ItemsSource="{Binding FilteredItems}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                     SelectionChanged="lstItems_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="60" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <TextBlock FontFamily="Webdings" Text="i" FontSize="34" Height="60" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" />
                            <TextBlock Grid.Column="1" FontSize="34" Text="{Binding Title,Mode=OneWay}" TextTrimming="WordEllipsis" VerticalAlignment="Center" HorizontalAlignment="Left" />
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="btnNewItem" Text="Add New Item" Click="btnNewItem_Click" />
                <shell:ApplicationBarMenuItem x:Name="btnDeleteWallet" Text="Delete This Wallet" Click="btnDeleteWallet_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
